#include <stdio.h>

int main() {
    int a[99] = { 0 }, sum = 0;
    int n;
    scanf("%d", &n);
    for (int i = 2; i <= n; i++)
    {
        a[i - 2] = i;
    }
    for (int i = 2; i <= n; i++)
    {
        for (int j = i - 1; j <= n - 2; j++)
        {
            if (a[j] % i == 0 && a[j] != 0)
            {
                a[j] = 0;
                sum++;
            }
        }
    }
    for (int i = 0; i <= n - 2; i++)
    {
        if (a[i] != 0)
            printf("%d ", a[i]);
    }
    printf("\n%d", sum);
    return 0;
}